package net.takela.common.web.dao;

import java.util.List;

/**
 * @author zhangyinghui
 * create at 2024/1/31
 */
public interface BaseDao<T,U> {
    /**
     *
     * @param entity entity
     * @return entity id
     */

    Boolean add(T entity);

    /**
     *
     * @param entity update entity
     * @return bool
     */
    Boolean update(T entity);

    /**
     *
     * @param id entity id
     * @return bool
     */
    Boolean remove(Long id);

    /**
     *
     * @param id entity id
     * @return entity
     */
    T get(Long id);

    /**
     *
     * @param searchArg search args
     * @return entities
     */
    List<T> search(U searchArg);
}
